package com.zzyy.study.service;

import com.zzyy.study.dao.ProductDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ProductService {
    @Autowired
    private ProductDao productDao;

    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public void updateProductStockCountById(Integer stockCount, Long id)
    {

        productDao.updateProductStockCountById(stockCount, id);

        //场景6注释掉，平时打开
        //int i = 10/0;//我要抛出异常
    }
}
